//
//  CustomUISegmentControl.m
//  Day4
//
//  Created by aaaaaa on 16/6/8.
//  Copyright © 2016年 赵五一. All rights reserved.
//

#import "CustomUISegmentControl.h"

@implementation CustomUISegmentControl

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithItems:(NSArray *)items{
    self = [super initWithItems:items];
    if (self) {
        [self setProperty];
    }
    return self;
}


- (void)setProperty{
    self.backgroundColor = [UIColor colorWithRed:101 / 255.0 green:200 / 255.0 blue:242 / 255.0 alpha:1.0];
    //改变边框和字体的颜色
    self.tintColor = [UIColor whiteColor];
    //设置下标为1的宽度
    [self setWidth:90 forSegmentAtIndex:1];
    //设置启动时选中的
    self.selectedSegmentIndex = 1;
    //禁用某个
    [self setEnabled:NO forSegmentAtIndex:0];
}

@end
